Quadratic Functions

Central Magnet School

Time: Menu

Lesson Overview

The student will learn about

Completing the Square

Complex Roots

Complex Numbers

parameters={a,c,d,x}

Application

The path of an object dropped out of a plane follows a parabolic curve. Notice that as the speed of the plane increases the parabola stretches outward.

Manipulate[
SeedRandom[seed];Module[{tf},Show[Graphics[{RGBColor[.6,.73,.36],Rectangle[{-.1,-.05},{(Sqrt[2])+.1,0}],Blue,Thickness[.005],Line[{{v t-.015,1.007},{v t-.015,1}}],Line[{{v t-.015,1},{v t+.02,1}}],Line[{{v t+.01,1.016},{v t+.005,.98}}],Thickness[.001],Dashed,Brown,Line[{{v t,1},{v t,1-.5(t^2)}}],Point[{v t,1-.5(t^2)}]},PlotRange->{{-.1,(Sqrt[2])+.1},{-0.05,1.05}},ImageSize->500],ParametricPlot[{v tf,1-.5(tf^2)},{tf,0,t},PlotStyle->Orange],If[t>1,With[{list=Table[With[{θ=RandomReal[{0,2π}]},{v+v0 Cos[θ](tf-1),.5+v0 Sin[θ] (tf-1)-.5(((tf-1))^2)}],{v0,RandomReal[{-1,1},RandomInteger[{4,9}]]}]},ParametricPlot[list,{tf,1,t},PlotStyle->Brown]],{}],Background->LightBlue]],{{t,.9,"time"},0.01,1.414,Appearance->"Labeled"},
{{v,.65,"speed"},0.65,1,Appearance->"Labeled"},
{{seed,4721359,"random seed"},(10^6),(10^7),1,Appearance->"Labeled"}]

Journal: This example ignores air resistance. In reality, do you think the object stay directly below the plane as suggested? Explain.

Application 2

Lets look at a more realistic example. Here, a plane is flying at an altitude of 10,000ft. Visualize how far (horizontally) the object flies given the velocity of the plane. This is modeled by the function f(x)=10000-16((((x/v)))^2) or as a parametric equation:

{({{x(t), =, v·t}, {y(t), =, 10000-16(t^2)}}).

Why is that? Remember from chapter 3 that x(t)=(Subscript[x, 0])+v·t·cosθ and y(t)=(Subscript[y, 0])+v·sinθ-(1/2)g·(t^2). In this case, θ is 0.

Manipulate[Plot[10000-16(((x/v))^2),{x,0,20000},PlotRange->{0,10000}],{{v,700,"Velocity in ft/sec"},1,801,10,Appearance->"Labeled"}]

Journal: Ignoring air resistance, how long would it take an object to hit 15,000 ft after the drop?

Modeling

Notice that a parabola can be formed with any three points. Click and drag each point to see how the parabola changes.

Manipulate[Plot[InterpolatingPolynomial[pts,x],{x,-10,10},PlotRange->{-10,10},PlotLabel],{{pts,{{1,1},{3,6},{-1,3}},""},{-10,-10},{10,10},{1,1},ControlType->Locator},TrackedSymbols->{pts}]

Journal: What is the only case in which a parabola cannot be formed? Why does it not work in this case?

Completing The Square (a=1)

Completing the square can be used to solve any quadratic equation or convert a standard quadratic equation into vertex form. Remember that the number used to complete the square is given by ((((b/2)))^2). Lets keep a as 1, so notice the first slider won’t move. See if you can follow the work shown, then change the values of b and c to get a different problem.

Manipulate[

d=b^2-4a c;
Pane[
Column[{
If[
a==0,
If[
b==0,
If[
c==0,
Plot[0,{x,-5,5},PlotRange->5,ImageSize->{200,200},PlotStyle->{Thick,Green}],
Plot[c,{x,-5,5},ImageSize->{200,200},PlotRange->5]
],

Plot[b x+c,{x,-5,5},PlotRange->5,ImageSize->{200,200},Epilog->{PointSize[.02],Green,Point[{{-c/b,0}}]}
]
],
(* else a≠ 0 *)
Plot[a x^2+b x +c,{x,-22,22},PlotRange->{-141,50},ImageSize->{200,200},Epilog->{PointSize[.02],Green,
If[
d≥0,
{
Point[{{(-b+Sqrt[d])/(2a),0},{(-b-Sqrt[d])/(2a),0}}]

},
{}
],Red,Point[{-b/(2a),-b^2/(4a)+c}]}]
],

Text@Style[Grid[{{

If[
a==0,
TraditionalForm@Column[
{
Row[{"a"," = ",0,", so the function is not quadratic and there is no square to complete."}]
},Alignment->{Left,Top},ItemSize->{{18},Automatic}
],
(* else a ≠ 0 *)
If[
b==0,
TraditionalForm@Column[
{
Row[{"b"," = ",0,", so the square is already complete."}]
},Alignment->{Left,Top},ItemSize->{{18},Automatic}
],
(* else b ≠ 0 *)
row1=Row[{a (x^2)+b x,If[c>0," + "," "],If[c!=0,c," "]," = 0"}];
row2=Row[{a( (x^2)+b/a x),If[c>0," + "," "],If[c!=0,c," "]," = 0"}];
row3=Row[{"(",a( (x^2)+2b/(2a) x+(b/(2a))^2),") - ",If[(b/(2a))^2!=0,(b/(2a))^2],If[c>0," + "," "],If[c!=0,c," "]," = 0"}];
row4=Row[{a(x+b/(2a))^2,If[c-b^2/(4a)>0," + "," "],If[c-b^2/(4a)!=0,c-b^2/(4a)," "]," = 0"}];
Text@TraditionalForm@Column[First/@Split[{row1,row2,row3,row4}],Alignment->{Left,Top},ItemSize->{{18},{3,3,3,3}}]
]
],

If[
a==0,
Column[{""},ItemSize->{{18},Automatic}],
(* else a≠0 *)
TraditionalForm@Column[{
Text@TraditionalForm@Row[{"The vertex is at ",RawBoxes["("],-b/(2a),,", ",-b^2/(4a)+c,RawBoxes[")"]}],
Text@TraditionalForm@
Row[{"The ",If[d≥0,"real","complex"]" roots are \n",x," = ",
If[
d≥0&&IntegerQ[Sqrt[d]/(2a)],
Row[{-b/(2a)+Sqrt[d]/(2a)," and ",-b/2a-Sqrt[d]/(2a)}],
Row[{-b/(2a),If[Abs[Sqrt[d]/(2.a)]>0," ± "," ∓ "],Abs[Sqrt[d]/(2a)]}]
] ,
If[d≥0,"",Row[{" ",I}]],"\n   ≈ ",
If[d≥0,
Row[{
NumberForm[(-b+Sqrt[d])/(2.a),{5,3}],
" and ",
NumberForm[(-b-Sqrt[d])/(2.a),{5,3}]
}],
(* else d<0 *)
Row[{
NumberForm[-b/(2.a),{5,3}],
If[
Abs[Sqrt[d]/(2.a)]==0,
"",
Row[{
If[Abs[Sqrt[d]/(2.a)]>0," ± "," ∓ "], NumberForm[Abs[Sqrt[d]/(2.a)],{5,3}]," ",I
}]
 ]
}]
],
"."}]
},Alignment->{Left,Top},ItemSize->{{18},{3,6,7}}]
]
}},Alignment->{Left,Top}],16]
},Center]
,ImageSize->{575,400}],
{{a,1},1,1,1,Appearance->"Labeled"},
{{b,4},-20,20,1,Appearance->"Labeled"},
{{c,10},-40,40,1,Appearance->"Labeled"},
TrackedSymbols->Manipulate
]

Journal: In terms of the graph, when do we get complex roots? Why?

Completing the Square

Lets look at the more difficult situation where a can be more than just 1.

Manipulate[

d=b^2-4a c;
Pane[
Column[{
If[
a==0,
If[
b==0,
If[
c==0,
Plot[0,{x,-5,5},PlotRange->5,ImageSize->{200,200},PlotStyle->{Thick,Green}],
Plot[c,{x,-5,5},ImageSize->{200,200},PlotRange->5]
],

Plot[b x+c,{x,-5,5},PlotRange->5,ImageSize->{200,200},Epilog->{PointSize[.02],Green,Point[{{-c/b,0}}]}
]
],
(* else a≠ 0 *)
Plot[a x^2+b x +c,{x,-22,22},PlotRange->{-141,50},ImageSize->{200,200},Epilog->{PointSize[.02],Green,
If[
d≥0,
{
Point[{{(-b+Sqrt[d])/(2a),0},{(-b-Sqrt[d])/(2a),0}}]

},
{}
],Red,Point[{-b/(2a),-b^2/(4a)+c}]}]
],

Text@Style[Grid[{{

If[
a==0,
TraditionalForm@Column[
{
Row[{"a"," = ",0,", so the function is not quadratic and there is no square to complete."}]
},Alignment->{Left,Top},ItemSize->{{18},Automatic}
],
(* else a ≠ 0 *)
If[
b==0,
TraditionalForm@Column[
{
Row[{"b"," = ",0,", so the square is already complete."}]
},Alignment->{Left,Top},ItemSize->{{18},Automatic}
],
(* else b ≠ 0 *)
row1=Row[{If[a≠1,If[a≠-1,a,"-"]," "], (x^2)+b x,If[c>0," + "," "],If[c!=0,c," "]," = 0"}];
row2=Row[{If[a≠1,If[a≠-1,a,"-"]," "],"(", (x^2)+b/a x,")",If[c>0," + "," "],If[c!=0,c," "]," = 0"}];
row3=Row[{If[a≠1,If[a≠-1,a,"-"]," "],"(", (x^2)+2b/(2a) x+(b/(2a))^2,If[a<0,") + ",") - "],If[a(b/(2a))^2!=0,Abs[a(b/(2a))^2]],If[c>0," + "," "],If[c!=0,c," "]," = 0"}];
row4=Row[{a(x+b/(2a))^2,If[c-b^2/(4a)>0," + "," "],If[c-b^2/(4a)!=0,c-b^2/(4a)," "]," = 0"}];
Text@TraditionalForm@Column[First/@Split[{row1,row2,row3,row4}],Alignment->{Left,Top},ItemSize->{{18},{3,3,3,3}}]
]
],

If[
a==0,
Column[{""},ItemSize->{{18},Automatic}],
(* else a≠0 *)
TraditionalForm@Column[{
Text@TraditionalForm@Row[{"The vertex is at ",RawBoxes["("],-b/(2a),,", ",-b^2/(4a)+c,RawBoxes[")"]}],
Text@TraditionalForm@
Row[{"The ",If[d≥0,"real","complex"]" roots are \n",x," = ",
If[
d≥0&&IntegerQ[Sqrt[d]/(2a)],
Row[{-b/(2a)+Sqrt[d]/(2a)," and ",-b/2a-Sqrt[d]/(2a)}],
Row[{-b/(2a),If[Abs[Sqrt[d]/(2.a)]>0," ± "," ∓ "],Abs[Sqrt[d]/(2a)]}]
] ,
If[d≥0,"",Row[{" ",I}]],"\n   ≈ ",
If[d≥0,
Row[{
NumberForm[(-b+Sqrt[d])/(2.a),{5,3}],
" and ",
NumberForm[(-b-Sqrt[d])/(2.a),{5,3}]
}],
(* else d<0 *)
Row[{
NumberForm[-b/(2.a),{5,3}],
If[
Abs[Sqrt[d]/(2.a)]==0,
"",
Row[{
If[Abs[Sqrt[d]/(2.a)]>0," ± "," ∓ "], NumberForm[Abs[Sqrt[d]/(2.a)],{5,3}]," ",I
}]
 ]
}]
],
"."}]
},Alignment->{Left,Top},ItemSize->{{18},{3,6,7}}]
]
}},Alignment->{Left,Top}],16]
},Center]
,ImageSize->{575,400}],
{{a,2},-5,5,1/2,Appearance->"Labeled"},
{{b,4},-20,20,1,Appearance->"Labeled"},
{{c,10},-40,40,1,Appearance->"Labeled"},
TrackedSymbols->Manipulate
]

Journal: Explain why the square is already complete when b = 0.

Complex Roots

As we saw earlier, complex roots are found when the parabola fails to intersect the x-axis. Here is a nice visual of how imaginary roots relate to the graph. See if you notice the pattern that the imaginary roots take the form (h±((Sqrt[k])/(Sqrt[a]))i). Don’t worry about forcing a to eaqual 1/v. Remember that an imaginary root and its conjugate are both roots.

Manipulate[
If[reset,{a,h,v,showfunction,forcea,reset}={1,1,1,False,False,False}];
If[forcea,a=Round[100/v]*.01];
If[Abs[a]<.0001,a=.00];
Plot[{a (((x-h))^2)+v,-a (((x-h))^2)-v},{x,-10,10},PlotStyle->{Black,{Blue,Dashed}},PlotRange->{-10,10},AspectRatio-> Automatic,Axes-> True,AxesLabel->{Row[{Style["x",Italic],", ",Style[Re,Red,Italic]}],Row[{Style["y",Italic],", ",Style[Im,Red,Italic]}]},TicksStyle->Directive[Red,12],ImageSize->{500,300},Prolog->{Text[Row[{Style[Superscript["ℝ",2], 12],Style[", ",12],Style[ℂ,Red,12]}],{-10,10},{-1,1}]},PlotLabel->Column[{
Row[{Style["y",Italic]," = ",Style["a",Italic]," (",Style["x",Italic]," - ",Style["h",Italic],")^2 + ",Style["k",Italic]," and ",Style["y",Italic]," = -",Style["a",Italic]," (",Style["x",Italic]," - ",Style["h",Italic],")^2 - ",Style["k",Italic]}],If[showfunction,Row[{Style["y",Italic]," = ",If[!Abs[a]<.0001,Row[{"±[",a (((x-h))^2)+v,"]"}],±Abs[v]],If[!Abs[a]<.0001,Row[{";  ",Style[zeros,Red],": ",Style[" (",Red],Style[NumberForm[N[h-((I (Sqrt[v]))/(Sqrt[a]))],{2,2}],Red],Style[")",Red]}],Row[{";  ",Style[Zeros,Red],": ",Style[None,Red]}]]}],""],""},Center],Epilog->If[!Abs[a]<.0001,{PointSize[Large],Red,Point[{Re[h-((I (Sqrt[v]))/(Sqrt[a]))],Im[h-((I (Sqrt[v]))/(Sqrt[a]))]}],PointSize[Large],Red,Point[{Re[h+((I (Sqrt[v]))/(Sqrt[a]))],Im[h+((I (Sqrt[v]))/(Sqrt[a]))]}]},{}]],
{{a,1,"coefficient of leading term, a"},-10,10,.01,Appearance->"Labeled"},
{{h,1,"horizontal translation, h"},-10,10,.01,Appearance->"Labeled"},
{{v,1,"vertical translation, v"},-9,9,.01,Appearance->"Labeled"},
Delimiter,
{{showfunction,True,"show equations & zeros"},{True,False}},
{{forcea,False,Row[{"force ","a"," to equal ", "1/v"," (vertices = zeros)"}]},{True,False}},
{{reset,False,"reset"},{False,True}},
TrackedSymbols->True,AutorunSequencing->{1,2,3}]

Journal: Is it possible to only have one imaginary root? Explain. (Hint: think about which processes result in imaginary roots.)

Quadratic Formula

The quadratic formula comes directly from completing the square. Therefore, it can be used in the same situations and result in the same answers. Even though it is not always necessary, it will always work.

var=Text@Style[#,Italic]&/@{(x^2),x};
times[x_]:=Text@Style[x,12];italic[x_]:=Text@Style[x ,Italic,12];
sign[a_:1,b_,x_]:=Which[x>0&&b≠0," + ",x<0,Style@" - ",x==0, "   ",a≠0,Style@" + ",True,"  "];
PlusMinusOne[x_]:=If[Abs[x]==1,"",Text@Style[x,12]]
Manipulate[
disc = (b^2)-4a c;twoA = 2a;
If[
Length[Level[Sqrt[disc],1]]≠0,coeff=Extract[Level[Sqrt[disc],1],1],coeff=1
];
If[coeff==disc,myGCD = 1,myGCD=GCD[coeff,twoA]];
comFactor = GCD[myGCD,twoA];
Column[
{Row[
{Text@times["Solve:   "],
Which[a==0,"  ",a>0,Row[{PlusMinusOne[a], var[[1]]}],True,If[a==-1,Row[{"-",var[[1]]}],Row[{PlusMinusOne[a], var[[1]]}]]],
sign[a,b],If[b==0,"",Row[{PlusMinusOne[Abs[b]],var[[2]]}]],sign[a,b,c],If[c==0,"",times[Abs[c]]]," = 0"}],
Row[{Text@Style["Use the quadratic formula: ",12],var[[2]],Text@Style[" = ",12],Text@Style[Row[{italic["-b"],Style[" ± ",12],(Sqrt[Row[{((italic["b"])^2),Style[" - 4",12],italic[ac]}]])}]/Row[{Style[2,12],italic["a"]}]]
}],
Text@Row[{italic["a"],Style[" = ",12],Style[a,12,CMYKColor[0,1,1,0],Bold],italic[";   b"],Style[" = ",12],Style[b,12,CMYKColor[.70,0,.70,.25],Bold],italic[";   c"],Style[" = ",12],Style[c,12,CMYKColor[1,.5,0,0],Bold]}
],
Text@Row[{italic["x"],Text@Style[" = ",12],Text@Style[Row[{Style["-(",12],Style[b,12,CMYKColor[.70,0,.70,.25],Bold],Style[")",12]}] ± √Row[{((Style[b,12,CMYKColor[.70,0,.70,.25],Bold])^2),Style[" - ",12],Style["4(",12],Style[a,12,CMYKColor[0,1,1,0]],Style[")(" ,12],Style[c, CMYKColor[1,.5,0,0],Bold],Style[")"]}],12]/Row[{Style[2,12],Style["(",12],Style[a,12,CMYKColor[0,1,1,0],Bold],Style[")",12]}]
}],
Text@Row[{italic["x"],Style[" = ",12],(1/(Style[2a,12]))Text@Row[{times[-b],Style[" ± ",12],√Row[{times[(b^2)],times[" - 4("],times[a c],times[")"]}]}]}],
Text@Row[{italic[" x"]," = ",Style[((Row[{times[-b],Style[" ± ",12],(Sqrt[times[(b^2)-4a c]])}])/(times[2a])) ,12]}],
Text@Row[{italic[" x"]," = ",Style[((Row[{times[-b],Style[" ± ",12],Style[(Sqrt[(b^2)-4a c]),12]}])/(times[2a])) ,12 ]}],
Text@Style["The solutions are "],
Text@Row[{Style["x",Italic,14,CMYKColor[1,1,0,0],Bold],Style[" = ",14],
Style[If[FractionalPart[Sqrt[disc]]!=0,Row[{If[b==0,"-",Row[{-b/twoA," - "}]],
If[comFactor ≠ Abs[twoA],HoldForm[a1/b1]/.a1->Sqrt[disc]/comFactor/.b1->Abs[twoA]/comFactor,Sqrt[disc/(coeff^2)]]}],
-b/twoA - Sqrt[disc]/twoA],14,CMYKColor[1,1,0,0],Bold]}],(*End of Row*)
Text@Row[{Style["x",Italic,14,CMYKColor[1,1,0,0],Bold],Style[" = ",14],
Style[If[FractionalPart[Sqrt[disc]]!=0,Row[{If[b==0,"",Row[{-b/twoA," + "}]],
If[comFactor ≠ Abs[twoA],HoldForm[a1/b1]/.a1->Sqrt[disc]/comFactor/.b1->Abs[twoA]/comFactor,Sqrt[disc/(coeff^2)]]}],
-b/twoA + Sqrt[disc]/twoA],14,CMYKColor[1,1,0,0],Bold]}](*End of Row*)
}],
{a,-50,50,1,Appearance->"Labeled"},
{b,-100,100,1,Appearance->"Labeled"},
{c,-50,50,1,Appearance->"Labeled"},
SaveDefinitions->True,
ControlPlacement->Left,ContentSize->{300,400},TrackedSymbols:>{a,b,c}]

Journal: Prove the quadratic formula using completing the square.

Graphing Complex Numbers

Try this game. Label each complex number as quick as possible.

Manipulate[
With[{st1=RandomKsublist[set2[9],n],st=RandomKsublist[set2[9],n]},
With[{st1C=Map[ToComplex,st1]},
nn=st;
Pane[Labeled[LocatorPane[Dynamic[nn],Graphics[Point[{0,0}],Axes->True,PlotRange->10,GridLines->If[!help,None,{Range[-10,10],Range[-10,10]}],GridLinesStyle->Directive[RGBColor[1, 0.72549, 0.72549],Thin],ImageSize->300,AxesLabel->{"real","imaginary"}],{{-9,-9},{9,9},{1,1}},Appearance->names1A[20]],Dynamic@Text@Grid[Table[{StringJoin[names2[[i]]," = ",ToString[st1C[[i]]]],nn[[i]]==st1[[i]]},{i,1,n}],Alignment->Left],Right],{450,300}]]],
{{n,14,"number of points"},1,15,1,Appearance->"Labeled"},
{{help,True,"show grid lines"},{False,True}},
{{nn,{{-7,5},{5,-3},{-3,6},{8,6}}},{-9,-9},{9,9},{1,1},ControlType->None},
Delimiter,
Style["Move the points to their given complex numbers!"],
SaveDefinitions->True,AutorunSequencing->{1,2},TrackedSymbols->True]

Journal:  What is |H|? Or in other words, how far is H from the origin?

Powers of i

Here is a nice visual of the pattern of i to the nth power.

Manipulate[Pane[Style[Grid[Table[{Row[{Superscript[I,i],"="}],I^i},{i,0,max}]],18,Bold],{500,415}],{{max,0,"maximum power"},0,15,1}]

Journal: What would (i^56) simplified? Prove it.